revision:
The property returns the previous element in the same tree level.
The property is read-only.
Syntax:
element.previousElementSibling : returns the previous sibling element; "null" if no previous sibling exists.
property value:
none :
example
The previous sibling of the second list item has the text:
<div>
<ul>
<li id="item1">Coffee (first item)</li>
<li id="item2">Tea (second item)</li>
</ul>
<p>The previous sibling of the second list item has the text: <span id="prop"></span></p>
</div>
<script>
let text = document.getElementById("item2").previousElementSibling.innerHTML;
document.getElementById("prop").innerHTML = text;
</script>